import Vue from 'vue'
//引入axios
import axios from 'axios'
import VueAxios from 'vue-axios'
//引入elementui
import ElementUI from 'element-ui';
//引入高德地图
import VueAMap from 'vue-amap';
//引入qs插件
import qs from 'qs';
//引入自定义主题
import './theme/index.css';
//引入message消息提示

import App from './App'
//引入路由
import router from './route'
//引入vuex
import store from './store'

//引入echars，按需引入开始
import * as echarts from 'echarts/core';
import {
    TitleComponent,
    TooltipComponent,
    LegendComponent,
    GridComponent
} from 'echarts/components';
import {
    PieChart,
    LineChart,
    BarChart
} from 'echarts/charts';
import {
    CanvasRenderer
} from 'echarts/renderers';
echarts.use(
    [TitleComponent, TooltipComponent, LegendComponent, PieChart, CanvasRenderer,GridComponent, LineChart,BarChart]
);
window.echarts = echarts
//引入echarts结束


//使用v-viewer图片查看器
import 'viewerjs/dist/viewer.css';
import Viewer from 'v-viewer';
Vue.use(Viewer);

//使用elementui
Vue.use(ElementUI);
//使用axios
Vue.use(VueAxios, axios);
//使用高德
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
    key:'afb85c21a3a099c9e469c10c069984d5',
    plugin:['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.MarkerClusterer'],
    v:'1.4.4'
});

//引入axios,qs全局定义
window.axios=axios;
window.qs=qs;

Vue.config.productionTip = false

//引入判断路由跳转的js
import '@/permission'

//引入图标
import '@/assets/fontIcon/iconfont.css'

//全局配置message
Vue.prototype.$message = function(msg){
    ElementUI.Message({
      ...msg,
      center:true,
      duration:1000
   })
}

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
